package com.sy.mapper.settings;

import com.sy.bean.settings.Dictionary;
import com.sy.common.crud.IMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

@Mapper
public interface DictionaryMapper extends IMapper<Dictionary> {
    /**
     * 字典查询
     * @param code
     * @return
     */
    List<Dictionary> queryDict(String code);

    /**
     * 新增字典
     * @param dictionary
     * @return
     */
    int saveDict(Dictionary dictionary);

    /**
     * 查询最大编码
     * @return
     */
    String queryMaxCode(String code);

    /**
     * 查询最大排序序号
     * @return
     */
    int queryMaxSorts(String code);

    /**
     * 修改
     * @param dictionary
     * @return
     */
    int updateDict(Dictionary dictionary);

    /**
     * 删除
     * @param id
     * @return
     */
    int delDict(int id);
}
